/*
 * @Description: 房屋相关接口
 * @Author: Yong
 * @Date: 2021-09-26 11:20:08
 * @LastEditTime: 2021-09-27 15:32:02
 */
import { Http } from '../utils'

const API = {
    getHouseList: '/houses',
    getHouseCondition: '/houses/condition',
}

/**
 * 根据条件查询房屋
 * @param params 查询条件 - { cityId: '', .... }
 */
export const getHouseList = function (params) {
    return Http('get', API.getHouseList, params)
}

/**
 * 获取城市房源的筛选条件
 * @param cityId
 */
export const getHouseCondition = function (cityId) {
     return Http('get', API.getHouseCondition, { id: cityId })
}


/**
 * 根据Id获取房源详细信息
 * @param id 直接拼接在URL后面
 */
export const getHouseDetail = function (id) {
    return Http('get', `${API.getHouseList}/${id}`,)
}